package com.orderServlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.order.OrderDao;
import com.vo.Order;

public class OrderModifyView extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			HttpSession session = request.getSession();
			Order order = new Order();
			List<Order> list = (List<Order>) session.getAttribute("AllOrder");
			
			if(request.getParameter("eo_id") != null){
				int id = 0;
				try {
					id = Integer.parseInt(request.getParameter("eo_id"));
				} catch (Exception e) {
					// TODO: handle exception
				}
				for(int a=0;a<list.size();a++){
					if(id==list.get(a).getEo_id()){
						order = list.get(a);
						
					}
				}
				session.setAttribute("modifyOrder", order);
				request.getRequestDispatcher("manage/order-modify.jsp").forward(request, response);
			}
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		
	}

}
